/**
 * 
 */
package com.hera.base.web.vaadin.component;



import com.vaadin.ui.OptionGroup;
import com.vaadin.ui.VerticalLayout;

/**
 * @author cmontes
 *
 */
public class FormOptionGroup extends VerticalLayout implements SimpleSelectable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 4690333850596898752L;
	
	private OptionGroup control;
	//private Label Label;
	
	
	public FormOptionGroup(){
		super();
		control = new OptionGroup();
		//control.addItem("Option 1");
		addComponent(control);
	}
	
	public FormOptionGroup(String label, String styleTextField){
		super();
		control = new OptionGroup();
		control.addItem(label);
		control.addStyleName(styleTextField);		
		addComponent(control);
		setId(label +"12");
	}

	@Override
	public void setLabel(String value) {
		// TODO Auto-generated method stub
		control.setCaption(value);
	}

	@Override
	public void setSize(Float value) {
		// TODO Auto-generated method stub
		control.setWidth(""+value + "px");
	}

	@Override
	public void setName(String value) {
		// TODO Auto-generated method stub
		setId(value);
	}

	@Override
	public String getLabel() {
		// TODO Auto-generated method stub
		return control.getCaption();
	}

	@Override
	public Float getSize() {
		// TODO Auto-generated method stub
		return control.getWidth();
	}

	@Override
	public String getName() {
		// TODO Auto-generated method stub
		return getId();
	}
	/*
	public void addOption(String value){
		control.addItem(value);
	}*/
	
	public void addOption(Object value){
		control.addItem(value);
	}

}
